package com.refusea.train.controller

import com.refusea.train.domain.helper.LoginHelper
import com.refusea.train.domain.req.LoginReq
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 * @author Zhang Yan 2024/3/24
 **/
@RestController
@RequestMapping("/api")
class LoginController(private val loginHelper: LoginHelper) {

    @PostMapping("/login")
    fun login(@RequestBody req: LoginReq): String {
        return loginHelper.login(req)
    }
}
